#include <iostream>

using namespace std;

int dp[1000005];

int main(){
    int t;
    cin >> t;

    for (int i = 1; i <= t; i++){
        int n;
        cin >> n;

        for (int j = 1; j <= n; j++){
            cin >> dp[j];
        }

        int maxsum = dp[1], start = 1, end = 1;

        for (int k = 2; k <= n; k++){
            if (dp[k - 1] + dp[k] >= dp[k]){
                dp[k] = dp[k - 1] + dp[k];
            }
            else{
                start = k;
            }

            if (dp[k] > maxsum){
                maxsum = dp[k];
                end = k;
            }
        }

        cout << "Case " << i << ":" << endl << maxsum << " " << start << " " << end << endl;
    }

    return 0;
}